package com.example.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 王鹤蒲
 * @since 2024-01-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain=true)
@TableName("sys_patient")
@ApiModel(value = "Patient对象", description = "")
public class Patient implements Serializable {

    private static final long serialVersionUID = 1L;

      @ApiModelProperty("患者ID")
      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("用户ID")
      private Integer userId;

      @ApiModelProperty("身份证号码")
      private String idNumber;

      @JsonFormat(pattern ="yyyy-MM-dd" ,timezone = "GMT+8")
      @JsonSerialize(using = LocalDateSerializer.class)
      @JsonDeserialize(using = LocalDateDeserializer.class)
      private LocalDate birthDate;

      @ApiModelProperty("账户")
      private Double account;

      @ApiModelProperty("创建者")
      private String createBy;

      @ApiModelProperty("创建时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      private LocalDateTime createTime;

      @ApiModelProperty("更新者")
      private String updateBy;

      @ApiModelProperty("更新时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      private LocalDateTime updateTime;

      @ApiModelProperty("备注")
      private String remark;

      @TableField(exist = false)
      private User user;

}
